package com.tr.ssocms.controller;


import com.tr.common.bo.User;
import com.tr.common.util.Result;
import com.tr.ssocms.service.AuthenticationService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
//@CrossOrigin
@RestController
@RequestMapping("/usersso")
public class UserLoginController {

    @Resource
    private AuthenticationService remoteUserService;

    @GetMapping("/login")
    public Result getUser(User user){
        return remoteUserService.checkUsernameAndPassword(user.getUserName(),user.getPassword());
    }
    @GetMapping("/reLogin")
    public Boolean checkUser(@RequestParam("token") String token){
        return remoteUserService.checkToken(token);
    }

}
